package com.heima.model.user.threadlocal;

public class AppThreadLocalUtils {

    private static final ThreadLocal<Integer> userThreadLocal = new ThreadLocal<>();

    public static void setUser(Integer userId){
        userThreadLocal.set(userId);
    }

    public static Integer getUser(){
        return userThreadLocal.get();
    }

    public static void clear(){
        userThreadLocal.remove();
    }

}
